<template>
  <div class="aftersale">
    <ul class="cartlist-bigbox">
      <li class="cartlist-box" v-for="item in orderlist" :key="item.id">
        <div class="toptext">
          <span class="icons">
             订单编号:
          </span>
          <span class="companyname">{{item.orderNo}}</span>
          <span class="text">等待买家付款</span>
        </div>
        <div class="paymentgoods" v-for="items in item.orderItems" :key="items.id">
          <div class="paymentgoods-box">
            <!-- <div class="int">
                <input type="checkbox" id="name" @change="click_input(items)">
            </div>-->
            <div class="paymentgoods-picture">
              <img :src="JSON.parse(items.goodsPic)">
            </div>
            <div class="paymentgoods-title" @click="goto(items)">
              <div class="paymentgoods-title-introduce">{{items.goodsName}}{{items.goodsIntro}}</div>
              <div class="paymentgoods-title-category">{{value}}</div>
              <div class="price">￥{{items.payPrice/100}}</div>
              <div class="num">X{{items.buyNum}}</div>
            </div>
          </div>
        </div>
      </li>
    </ul>
    <!-- <div class="total">
      <div class="totalprice">合计：￥{{totale}}</div>
      <div class="text">
        <span class="logistics">取消订单</span>
        <span class="surereaive">付款</span>
      </div>
    </div>-->
  </div>
</template>

<script>
import pic8 from "../../../icons/shop.png";
import * as api from "../../../request/api.js";
export default {
  name: "paymoney",
  data() {
    return {
      images8: pic8,
      value: "",
      orderlist: [],
      orderNo: "",
      id: "",
      totale: ""
    };
  },
  created() {
    this.$http({
      method: "post",
      url: api.ORDERLIST,
      data: {
        pageNo: 1,
        pageSize: 10,
        payStatus: 1
      }
    })
      .then(resp => {
        console.log(resp);
        this.orderlist = resp.data.data;
        resp.data.data.forEach(item => {
          this.id = item.id;

          //  console.log(item)
          item.orderItems.forEach(items => {
            //  console.log(JSON.parse(items.goodsAttrSpecInfo))
            JSON.parse(items.goodsAttrSpecInfo).forEach(items2 => {
              // console.log(items2.value)
              this.value = items2.value;
            });
          });

          this.orderNo = item.orderNo;
          console.log(this.orderlist);
        });
      })
      .catch(resp => {});
  },
  methods: {
    goto(items) {
      console.log(items.orderId, this.orderNo, items.transactionStatus);
      this.$router.push({
        path: "./orderdetails",
        query: {
          id: items.orderId,
          orderNo: this.orderNo,
          transactionStatus: items.transactionStatus
        }
      });
    }
  }
};
</script>

<style lang="less" scoped>
.price {
  font-size: 26px;
  color: #a1363c;
  margin-top: 65px;
}
.companyname {
  font-size: 26px;
}
.all {
  width: 100%;
  height: 100%;
}
&-box {
  width: 100%;
}
.elsetext {
  font-size: 28px;
  color: #333333;
  text-align: center;
  margin-top: 150px;
  margin-bottom: 40px;
}
.elsetextcenter {
  font-size: 24px;
  color: #999;
  margin-bottom: 40px;
  text-align: center;
}
.cartlist-box {
  margin-bottom: 10px;
}
  .icons{
    margin-left: 3%;
  }
.elsetextbottom {
  font-size: 28px;
  width: 150px;
  height: 60px;
  border: 1px solid #a1363c;
  text-align: center;
  line-height: 60px;
  margin: 0 auto;
  color: #a1363c;
}
input[type="checkbox"] {
  -webkit-appearance: none;
  vertical-align: middle;
  margin-top: 0;
  background: #fff;
  border: #999 solid 1px;
  border-radius: 3px;
  min-height: 20px;
  min-width: 20px;
  border-radius: 50%;
}
input[type="checkbox"]:checked {
  background: #a1363c;
  border: none;
}
input[type="checkbox"]:checked::after {
  content: "";
  top: 28px;
  left: 33px;
  position: absolute;
  background: transparent;
  border: #fff solid 2px;
  border-top: none;
  border-right: none;
  height: 5px;
  width: 10px;
  -moz-transform: rotate(-45deg);
  -ms-transform: rotate(-45deg);
  -webkit-transform: rotate(-45deg);
  transform: rotate(-45deg);
}
.toptext {
  width: 100%;
  height: 60px;
  background: #fff;
  font-size: 20px;
  color: #333333;
  line-height: 60px;
  .images8 {
    width: 25px;
    height: 25px;
    margin-left: 20px;
    margin-right: 10px;
  }
  .text {
    font-size: 26px;
    color: #a1363c;
    float: right;
    margin-right: 40px;
  }
}
.paymentgoods {
  width: 100%;
  margin-bottom: 2px solid #f2f2f2;
  position: relative;
  &-box {
    width: 100%;
    height: 230px;
    background: #fff;
    padding-top: 30px;
    display: flex;
    letter-spacing: 2px;
    .int {
      width: 20px;
      height: 170px;
      line-height: 170px;
      margin-left: 3%;
      position: relative;
      input[type="checkbox"]:checked::after {
        content: "";
        top: 79px;
        left: 4px;
        position: absolute;
        background: transparent;
        border: #fff solid 2px;
        border-top: none;
        border-right: none;
        height: 5px;
        width: 10px;
        -moz-transform: rotate(-45deg);
        -ms-transform: rotate(-45deg);
        -webkit-transform: rotate(-45deg);
        transform: rotate(-45deg);
      }
    }
  }

  &-picture {
    width: 200px;
    height: 200px;
    margin-left: 3%;
    margin-right: 20px;
    img {
      width: 200px;
      height: 200px;
    }
  }

  &-title {
    flex: 1;
    margin-right: 3%;

    &-introduce {
      font-size: 26px;
      color: #666666;
      line-height: 30px;
    }
    &-category {
      font-size: 22px;
      color: #999999;
      margin-top: 20px;
    }

    .num {
      float: right;
      position: absolute;
      top: 195px;
      right: 40px;
      font-size: 24px;
    }
  }
}
.total {
  width: 100%;
  height: 120px;
  background: #fff;
  display: flex;
  padding-top: 10px;

  flex-direction: row-reverse;
  position: relative;
  .logistics {
    width: 120px;
    height: 40px;
    line-height: 40px;
    font-size: 22px;
    text-align: center;
    color: #666666;
    border: 2px solid #333333;
    border-radius: 30px;
    color: #333333;
    position: absolute;
    right: 180px;
    top: 50px;
  }
  .surereaive {
    width: 80px;
    height: 40px;
    line-height: 40px;
    font-size: 22px;
    text-align: center;
    color: #666666;
    border: 2px solid #a1363c;
    border-radius: 30px;
    color: #a1363c;
    position: absolute;
    right: 40px;
    top: 50px;
  }
  .totalprice {
    font-size: 24px;
    color: #999999;
    margin-right: 40px;
  }
}
</style>
